from typing import List


def arrayPairSum(nums: List[int]) -> int:
    nums.sort()
    res = 0
    for i in range(0,len(nums),2):
        res += nums[i]
    return res

def arrayPairSum1(nums: List[int]) -> int:
    nums.sort()
    return sum(nums[::2])